<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.global.js'></script>
</head>

<body>
    <div id="app">
        <alert-box>
            <h3>快别吃鸡了！！！</h3>
            <h1>你老婆跟别人跑了！！！</h1>
        </alert-box>
    </div>

    <script>
        const app = Vue.createApp({})

        app.component('alert-box', {
            template: `
            <div class="demo-alert-box">
                <strong>Error!</strong>

                <!-- 错误信息无法提前预知 由父组件自行插入一个自定义的DOM结构 -->
                <slot></slot>
            </div>
            `
        })

        app.mount('#app')
    </script>
</body>

</html>